package com.liuchong.cloudquotation.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author: liuchong
 * @create: 2023/2/27 18:08
 * @description:
 */
@RestController
public class QuotationController {
    @Autowired
    private RestTemplate restTemplate;
    @RequestMapping(value = "quotation", method = RequestMethod.GET)
    public String getQuotation(@RequestParam(value = "data") String data) {
        String url = "http://quotation/"+data;
        String result = restTemplate.getForObject(url,String.class);
        return result + "One";
    }
}
